﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Happy.Web.Mvc;
using Happy.Cms.Application.Articles;
using Ciep.WebSite.Models;

namespace Ciep.WebSite.Controllers
{
    public abstract class CiepController : HappyController
    {
        protected void SetCommonDataToViewBag()
        {
            this.ViewBag.Title = this.Title;
            this.ViewBag.MenuIndex = this.MenuIndex;
        }

        protected virtual string ControllerName
        {
            get
            {
                object controller;
                if (this.RouteData.Values.TryGetValue("Controller", out controller))
                {
                    return controller.ToString();
                }

                return this.GetType().Name;
            }
        }

        protected abstract string Title { get; }

        protected abstract int MenuIndex { get; }
    }
}
